<!--tvm票款差异协查-->
<template>
  <div class="zhanNeiRYDLCK approve el-card is-always-shadow el-card__body">
    <el-dialog
      title="预览"
      :visible.sync="dialogVisible"
      @close="closed"
      width="950px">
      <avue-form v-if="isReload" class="shouPiaoYuanCYQRTZForm" :option="option" v-model="formData" @submit="handleSubmit">
        <template slot-scope="scope" slot="recordTime">
          <span>{{scope.value}}</span>
        </template>
        <template slot-scope="scope" slot="supPaymentTime">
          <span>{{scope.value}}</span>
        </template>
        <template slot-scope="scope" slot="shortAmount">
          <span>{{scope.value}}</span>
        </template>
        <template slot-scope="scope" slot="conductorPerson">
          <span>{{scope.value}}</span>
        </template>
        <template slot-scope="scope" slot="conductorPersonCode">
          <span>{{scope.value}}</span>
        </template>
        <template slot-scope="scope" slot="menuForm">
          <el-button type="primary" v-if="buttonShowType == 0" @click="handleSubmit(2)">保存</el-button>
          <el-button type="default" @click="closed">取消</el-button>
        </template>
      </avue-form>
    </el-dialog>
  </div>
</template>


<script>
import {
  fenExYuangettoFixed
} from "@/api/subwayRat/commonCheck";

export default {
  components:{
  },
  data() {
    return {
      isReload:true,
      //1期限内，2期限外
      showType:1,
      buttonShowType:0,
      dialogVisible:true,
      lineCodes:[],
      selectedKeys:[],
      stationCodes:[],
      conductorPersonNames:[],//售票员名称
      operationCodes:[],
      headers:{},
      formData:{
        dynamic: []
      },
      option:{
      },
      parentThis:null
    }
  },
  created() {
  },
  methods: {
    fenExYuangettoFixed,
    handleSubmit(){
      this.closed();
    },
    recallShow(row,parentThis){
      this.parentThis=parentThis;
      this.getOption();
      Object.assign(this.formData,row)
      this.formatAmount(this.formData,true);
      this.buttonShowType=1;
    },
    formatAmount(row,isYuan){
      if(isYuan){
        row.shortAmount=fenExYuangettoFixed(row,'shortAmount');
      }else{
        row.shortAmount=Number(row.shortAmount)*100;
      }
    },
    closed(){
      this.dialogVisible=false;
      this.$parent.dialogVisibleprev=false;
    },
    getOption(){
      let th=this;
      this.option=this.getAddOption(th);
      this.isReload=false;
      this.$nextTick(()=>{
        this.isReload=true;
      })
    },

    getAddOption(th) {
      return {
        submitBtn:false,
        emptyBtn:false,
        group:[
          {
            icon:'',
            label: '',
            // collapse:false,
            prop: 'group1',
            column: [{
              label: '收入日期',
              prop: 'recordTime',
              // width:'250',
              labelWidth:130,
              type:'date',
              format:"yyyy-MM-dd",
              valueFormat: 'yyyy-MM-dd',
              formslot:true,
            },{
              label: '补款日期',
              prop: 'supPaymentTime',
              // width:'250',
              type:'date',
              labelWidth:130,
              format:"yyyy-MM-dd",
              valueFormat: 'yyyy-MM-dd',
              formslot:true,
            },{
              label: '补款金额',
              prop: 'shortAmount',
              labelWidth:130,
              type:'number',
              precision:2,
              formslot:true,
            },{
              label: '补款人',
              prop: 'conductorPerson',
              // width:'250',
              labelWidth:130,
              type:'select',
              disabled:true,
              formslot:true,
            },{
              label: '补款人工号',
              prop: 'conductorPersonCode',
              // width:'250',
              labelWidth:130,
              type:'select',
              disabled:true,
              formslot:true,
            }]
          },
        ]
      };
    }
  },
  mounted() {
  }
}
</script>
<style lang="scss">
.huLianWangShouPiaojiDataInput.EditorOrAdd{
  .avue-group[index='2']{
    .avue-form__group{
      .avue-form__row{
        width: 100%;
      }
    }
  }
  @media only screen and (min-width: 992px){
    width: 100%;
  }
  .avue-crud__tip{
    display: none;
  }
}
.zhanNeiRYDLCK {
  .upload-fujian{
    display: inline-flex;
    .el-upload-list {
      display: none;
    }
  }

}
</style>
